package com.lucifer.cloud.auth.util;

import jakarta.servlet.http.HttpServletRequest;

import java.util.Enumeration;

/**
 * @author lucifer
 * @date 2023/12/29 9:58
 */
public class UserUtils {
    public static String token(HttpServletRequest request){
        Enumeration<String> authorizations = request.getHeaders("Authorization");
        String token = null;
        while (authorizations.hasMoreElements()) {
            String element  = authorizations.nextElement();
            String[] split = element.split("Bearer ");
            token = split[1];
        }
        return token;
    }
}
